Package edu.claflin.finder.logic
Class Node
java.lang.Object
edu.claflin.finder.logic.Node
- All Implemented Interfaces:
Comparable<Node>
- Direct Known Subclasses:
ModuleNode
Represents a node in memory. A simple implementation requiring only an
identifier.
- Version:
- 1.1.1 June 16, 2015
- Author:
- Charles Allen Schultz II
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an Edge to the Node and increase the other statistics accordingly.intReturns a copy of this Node that is a new object in memory.booleanintGet the Node's in-degree.getEdges()Get the Node's edgesintgetFreq()Access method for the Node's identifier.intGet the index of the Node in its Graph's Node list.Get the Node's neighborsdoubleGet the Node's weightinthashCode()voidvoidremoveEdge(Edge e) voidsetIntegerIdentifier(int i) toString()
-
Field Details
-
identifier
The string representing the node's unique name. -
intIdentifier
private int intIdentifier -
freq
private int freq -
edges
-
neighbors
-
degree
private int degree -
weight
private double weight
-
-
Constructor Details
-
Node
Initializes the Node object.- Parameters:
identifier- the String representing the Node's identifier.
-
-
Method Details
-
getIdentifier
Access method for the Node's identifier.- Returns:
- the String identifying the Node.
-
getIntegerIdentifier
public int getIntegerIdentifier()Get the index of the Node in its Graph's Node list.- Returns:
- the index in the graph node list
-
getEdge
-
getEdges
Get the Node's edges- Returns:
- the node's edges
-
getNeighbors
Get the Node's neighbors- Returns:
- the node's neighbors
-
getDegree
public int getDegree()Get the Node's in-degree.- Returns:
- the node's degree
-
getWeight
public double getWeight()Get the Node's weight- Returns:
- the node's weight
-
setIntegerIdentifier
public void setIntegerIdentifier(int i) -
addEdge
Add an Edge to the Node and increase the other statistics accordingly.- Parameters:
e- the Edge to add
-
removeEdge
-
duplicate
Returns a copy of this Node that is a new object in memory.- Returns:
- the copy of the Node
-
incrementFreq
public void incrementFreq() -
getFreq
public int getFreq() -
equals
-
hashCode
public int hashCode() -
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<Node>
-